package com.shuangk.majingze.coolpapa;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.shuangk.majingze.coolpapa.contract.main.MainContract;
import com.shuangk.majingze.coolpapa.http.RetrofitClient;
import com.shuangk.majingze.coolpapa.model.User;
import com.shuangk.majingze.coolpapa.model.UserCache;
import com.shuangk.majingze.coolpapa.presenter.MainPresenterImpl;

import java.util.HashMap;
import java.util.Map;

import okhttp3.ResponseBody;
import rx.Subscriber;

public class MainActivity extends AppCompatActivity implements MainContract.View {

    private MainContract.Presenter presenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        new MainPresenterImpl(this);
        initView();
        UserCache.getInstance(this).setUser(new User("张三","ssss"));
    }

    @Override
    public void initView() {
        presenter.checkUser();
    }

    @Override
    public void setPresenter(MainContract.Presenter presenter) {
        this.presenter = presenter;
    }
}
